package com.example.user.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.example.baselibrary.ui.activity.BaseMvpActivity;
import com.example.baselibrary.utils.ToastUtil;
import com.example.baselibrary.utils.ZLog;
import com.example.user.R;
import com.example.user.iview.LoginView;
import com.example.user.presenter.LoginPresenter;

/**
 * 登录界面
 */
public class LoginActivity extends BaseMvpActivity<LoginPresenter> implements LoginView {

    @Override
    protected int getLayoutId() {
        return R.layout.activity_login;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mPresenter = new LoginPresenter();
        mPresenter.mView = this;        //初始化view,让此activity实现view

        mPresenter.Login();
    }


    /*------------------登录回调----------------*/
    @Override
    public void onLoginResult(String result) {
        ZLog.e(result);

        ToastUtil.ToastMsg(this, result);
    }

}
